import 'dart:convert';
import 'dart:io';
import 'dart:ui';

import 'package:dk_flutter_base/dk_core.dart';
import 'package:dk_flutter_base/dk_ui.dart';
import 'package:dk_flutter_module_sale/common/common_search/bean/bean_common_search.dart';
import 'package:dk_flutter_module_sale/common/common_search/page/page_common_search.dart';
import 'package:dk_flutter_module_sale/common/common_search/page/page_search_sale_name.dart';
import 'package:dk_flutter_module_sale/config/native_config.dart';
import 'package:dk_flutter_module_sale/portal/msg/page/page_message.dart';
import 'package:dk_flutter_module_sale/sale/sale_out/business_statistic/bean/bean_view_target.dart';
import 'package:dk_flutter_module_sale/sale/sale_out/business_statistic/page/page_view_target.dart';
//import 'package:dk_flutter_module_sale/sale/sale_out/following_record_detail/widget/widget_section.dart';
import 'package:dk_flutter_module_sale/sale/sale_out/watch_plan/bean/bean_data_commonlist_config.dart';
import 'package:flutter/material.dart';
import 'Widget/widget_input.dart';
import 'Widget/widget_section.dart';
import 'data/test_data_view_target.dart';
import 'page/test_dash.dart';
import 'page/test_flow.dart';
import 'page/test_tab.dart';
import 'page/test_refresh_page.dart';
/*
void main() {
  /*NativeConfig nativeConfig;
  if (Platform.isAndroid) {
    nativeConfig = NativeConfig(
      appId: "20",
      clientSecret: "ivmtpMnYvejCsq3a96wQ12qwelQchPXc",
      nativeEnv: "DEBUG",
      portalBaseUrl: "http://172.18.11.23:8888",
      saleInBaseUrl: "http://172.18.130.18",
      saleOutBaseUrl: "http://172.18.130.18",
    );
  }
  Test(nativeConfig, PortalHomeMsg(null));*/
  var data = SearchData()
    ..type = "list"
    ..placeholder =
        "hahahahahahhahahahhahahahhahahahhahahahhahahahhahahahhahahahhahahahhah"
    ..cacheKey = "cacheKey"
    ..dimKey = "dimKey"
    ..listData = (List()
      ..add(SearchItem()
        ..title = "title1"
        ..jumpType = "title1_jumpType"
        ..route = "title1_route"
        ..searchKey = "title1_searchKey")
      ..add(SearchItem()
        ..title = "title2"
        ..jumpType = "title2_jumpType"
        ..route = "title2_route"
        ..searchKey = "title2_searchKey")
      ..add(SearchItem()
        ..title = "title3"
        ..jumpType = "title3_jumpType"
        ..route = "title3_route"
        ..searchKey = "title3_searchKey")
      ..add(SearchItem()
        ..title = "title4"
        ..jumpType = "route"
        ..route = "dkwidget"
        ..searchKey = "title4_searchKey"));
  runApp(MaterialApp(
    title: 'Flutter Demo',
    theme: ThemeData(
        primaryColor: Colors.white,
        backgroundColor: Colors.white,
        accentColor: Color(0xFF3DBCC6),
        primaryColorBrightness: Brightness.light,
        primaryTextTheme: TextTheme(
//设置Material的默认字体样式
          title: TextStyle(color: Color(0xff333333), fontSize: 17.0),
        ),
        primaryIconTheme: IconThemeData(
          color: Color(0xff333333),
          size: 20.0,
        ),
        appBarTheme: AppBarTheme(
            textTheme: TextTheme(
              title: TextStyle(color: Color(0xff333333), fontSize: 17),
              body1: TextStyle(color: Color(0xff333333), fontSize: 17),
            ),
            elevation: 0.5,
            actionsIconTheme: IconThemeData(size: 16))),
    home: SafeArea(
        child: Scaffold(
/*
      body: ViewTargetWidget(
          ViewTargetBean.fromJson(json.decode(viewTargetData))
      ),
*/
//      body: new RefreshPage(),
//      body: MyFlow(
//        maxLine: 10,
//        padding: EdgeInsets.all(40),
//        runSpacing: 40,
//        children: <Widget>[
//          Text("1111111111"),
//          Text("2222222"),
//          Text("333"),
//          Text("444444444444444444444"),
//          Text("55555555"),
//          Text("666666666666666666666666666666"),
//          Text("7"),
//          Text("1111111111"),
//          Text("2222222"),
//          Text("333"),
//          Text("444444444444444444444"),
//          Text("55555555"),
//          Text("666666666666666666666666666666"),
//          Text("7"),
//          Text("1111111111"),
//          Text("2222222"),
//          Text("333"),
//          Text("444444444444444444444"),
//          Text("55555555"),
//          Text("666666666666666666666666666666"),
//          Text("7"),
//        ],
//      ),
//      body: CommonSearchPage(WidgetOption("11", data.toJson())),
      body: Column(
        children: <Widget>[SectionWidget(
            title: "跟进结果",
          subTitle: "(可多选)",
        ),SectionWidget(
          title: "跟进结果",
          bottomLineHidden: false,
        )],
      ),
//      body: Row(children: <Widget>[
//        Text("111111"),
//        Expanded(
//          child: Padding(
//            child: DkText.withOption(TextOption.ellipsis(
//                "222222222222222222222222222222222222222222222222222222222222222222222222222",
//                14,
//                Colors.red)),
//            padding: new EdgeInsets.only(left: 5),
//          ),
//        ),
//      ]),
//          body: SearchSaleNamePage(WidgetOption("11", (SecondSearchItem()..searchKey="111"..searchValue="2222"..displayName="99999").toJson())),
    )),
  ));
}
*/
/*
void main(){
  runApp(MaterialApp(
    home: Scaffold(
      appBar: AppBar(title: Text("测试"),),
      body: TestWidget()
    ),
  ));
}

class TestWidget extends StatelessWidget {
  final TextEditingController controller = TextEditingController(text: "11");
  final FocusNode focusNode = FocusNode();
  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      behavior: HitTestBehavior.translucent,
      onTap: (){
        this.focusNode.unfocus();
      },
      child: Container(
        color: Colors.green,
        child: Column(
          children: <Widget>[
            SectionWidget(
              title: "跟进记录",
            ),
            InputStatefulWidget(
              maxLength: 10,
              focusNode: this.focusNode,
              showWaringText: true,
              controller: controller,
              placeholder: "请填写跟进详情",
              //readOnly: true,
            ),
            FlatButton(
              child: Text("获取值"),
              color: Colors.red,
              onPressed: (){
                print("文本框文字为${this.controller.text}");
                this.focusNode.unfocus();
              },
            )
          ],
        ),
      ),
    );
  }
}
*/

